#ifndef WORLD_MANAGER_H
#define WORLD_MANAGER_H

#include <vector>
#include <unordered_map>
#include <memory>
#include "scene.h"
#include "entity.h"

namespace world {

class WorldManager
{
public:
    static WorldManager& instance();
    
    bool init();
    void update();
    void shutdown();
    
    bool add_scene(std::shared_ptr<Scene> scene);
    std::shared_ptr<Scene> get_scene(int scene_id) const;
    void remove_scene(int scene_id);
    
    bool add_entity_to_scene(std::shared_ptr<Entity> entity, int scene_id);
    void remove_entity_from_scene(int entity_id, int scene_id);
    
    std::shared_ptr<Entity> get_entity(int entity_id) const;
    
private:
    WorldManager();
    ~WorldManager();
    
    WorldManager(const WorldManager&) = delete;
    WorldManager& operator=(const WorldManager&) = delete;
    
    std::unordered_map<int, std::shared_ptr<Scene>> scenes_;
    std::unordered_map<int, std::shared_ptr<Entity>> entities_;
};

} // namespace world

#endif // WORLD_MANAGER_H    